<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .div{
      padding: 50px;
      background-color: rgb(163, 44, 44);
    }
    .div2{
      background-color: rgb(182, 199, 33);
    }
    .div3{
      background-color: rgb(66, 64, 177);
    }
  </style>
</head>
<body>
  <div id="app">
    <div class="div1 div" @click="fn1">
      <div class="div2 div" @click="fn2">
        <div class="div3 div" @click="fn3"></div>
      </div>
    </div>
    <a @click="link" href="http://www.baidu.com">百度一下</a>
    <button @click="clickBtn">按钮</button>
  </div>
  <script src="./vue.js"></script>
  <script>
    const vm = new Vue({
      el: '#app',
      data: {
        msg: '事件'
      },
      methods: {
        fn3(e){

         e.stopPropagation();
          console.log(3);
        },
        fn2(){
          console.log(2);
        },
        fn1(){
          console.log(1);
        },
        link(e){
          e.preventDefault();
        },
        clickBtn(e){
          console.log(e.target);
          e.target.style.background="red";
        }
      }
    })
  </script>
</body>
</html>